package com.fdd.spring.aop.aspectj;

import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AopAspectjTest {
    @Test
    public void smartAnimalableTest(){

        //得到容器
        ApplicationContext ioc = new ClassPathXmlApplicationContext("beans08.xml");
//        SmartAnimalable smartAnimalable = ioc.getBean(SmartAnimalable.class);//类似于getProxy()
        SmartAnimalable smartAnimalable = (SmartAnimalable) ioc.getBean("smartDog");
        smartAnimalable.getSum(1, 2);
//        smartAnimalable.getSub(1, 2);


//        Car car = (Car) ioc.getBean("car");
//        System.out.println(car.getClass().getName());
//        car.run();

    }
}
